<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2020/9/9
 * Time: 20:18
 */

namespace App\Logic;


use EasySwoole\EasySwoole\Config;

class ToolLogic
{
    /**
     * 生成缩列图
     */
    public static function thumb($path,$thumbWidth,$thumbHeight){
        $host = Config::getInstance()->getConf('APP.FILE_DOMAIN');
        return "{$host}{$path}?imageView2/1/w/{$thumbWidth}/h/{$thumbHeight}";
    }

    /**
     * 生成视频封面图
     */
    public static function videoCover($path,$thumbWidth,$thumbHeight){
        $host = Config::getInstance()->getConf('APP.FILE_DOMAIN');
        return "{$host}{$path}?vframe/jpg/offset/0/w/{$thumbWidth}/h/{$thumbHeight}";
    }
}